﻿Imports System
Module CustomException
    Public Class MyException
        Inherits Exception

        Public Sub New()
        End Sub

        Public Sub New(message As String)
            MyBase.New(message)
        End Sub

        Public Sub New(message As String, inner As Exception)
            MyBase.New(message, inner)
        End Sub

        Public Sub Show(query As String, conn_str As String)
            Dim err As New Text.StringBuilder("Lỗi truy xuất CSDL " & vbCrLf)
            err.Append("Chuỗi lệnh :" & query & vbCrLf)
            err.Append("Chuỗi kết nối :" & conn_str & vbCrLf)
            err.Append("Lỗi :" & Me.Message & vbCrLf)
            MessageBox.Show(err.ToString())
        End Sub
    End Class
End Module
